{% extends 'TopxiaWebBundle:CourseManage:layout.html.twig' %}
{% import 'TopxiaWebBundle::macro.html.twig' as macro %}

{% block title %}{{ '试卷管理'|trans }} - {{ parent() }}{% endblock %}

{% set side_nav = 'testpaper' %}
{% set parentId = parentId | default(null) %}
{% set script_controller = 'test-paper/index' %}

{% block main %}

  <div class="panel panel-default panel-col">
    <div class="panel-heading">
      <a href="{{ path('course_manage_testpaper_create',{courseId:course.id}) }}"
         class="btn btn-info btn-sm pull-right mls"><span class="glyphicon glyphicon-plus"></span>{{ '创建试卷'|trans }}</a>
      {{ '试卷管理'|trans }}
    </div>

    <div class="panel-body " id="quiz-table-container">

      <table class="table table-striped table-hover" id="quiz-table">
        {{ web_macro.flash_messages() }}
        <thead>
        <tr>
          <th><input type="checkbox" autocomplete="off" data-role="batch-select"></th>
          <th width="38%">{{ '名称'|trans }}</th>
          <th>{{ '状态'|trans }}</th>
          <th>{{ '题目统计'|trans }}</th>
          <th>{{ '时间限制'|trans }}</th>
          <th>{{ '更新人/时间'|trans }}</th>
          <th>{{ '操作'|trans }}</th>
        </tr>
        </thead>
        <tbody>
        {% for testpaper in testpapers %}
          {% set user = users[testpaper.updatedUserId] %}
          {% include 'TopxiaWebBundle:CourseTestpaperManage:tr.html.twig' %}
        {% else %}
          <tr>
            <td colspan="20">
              <div class="empty">{{ '还没有试卷，请点击右上角按钮，'|trans }}<a
                    href="{{ path('course_manage_testpaper_create',{courseId:course.id}) }}">{{ '创建一个新试卷'|trans }}</a>
              </div>
            </td>
          </tr>
        {% endfor %}
        </tbody>
      </table>
      <div>
        <label class="checkbox-inline"><input type="checkbox" autocomplete="off" data-role="batch-select"> 全选</label>
        <button class="btn btn-default btn-sm mlm" data-role="batch-delete" data-name="{{ '试卷'|trans }}"
                data-url="{{ path('course_manage_testpaper_deletes',{courseId:course.id}) }}">{{ '删除'|trans }}</button>
      </div>

      {{ web_macro.paginator(paginator) }}

      <div class="text-muted mtl">
        {{ '提示：试卷一旦发布不能修改，发布后的试卷需要'|trans }}
        <strong>
          {{ '添加到课时'|trans }}
        </strong>
        {{ '中才能正常使用。'|trans }}
      </div>
    </div>
  </div>

{% endblock %}



